<?php
class log{
	public function init($params=array()){
		$this->db=$this->yum->library($this->yum->vars('app','database'));
		$this->prefix=$this->yum->vars('app','prefix');
	}
	public function Count($params=array()){
		$params['select']='COUNT(*) AS count';
		return $this->db->select($this->prefix.'log',$params);
	}
	public function Glog($params=array()){
		return $this->db->select($this->prefix.'log AS A',$params);
	}
    public function GlogFull($params=array()){
		$table=$this->prefix.'log AS A';
		$table.=' LEFT JOIN '.$this->prefix.'member AS B ON A.member=B.id';
		$params['select']='B.mail,A.label,A.content,A.time,A.ip';
    	return $this->db->select($table,$params);
    }
	public function ILog($params){
		return $this->db->insert($this->prefix.'log',$params);
	}
	public function ULog($params){
		return $this->db->update($this->prefix.'log',$params);
	}
}
?>